<form class="form-horizontal loginform" id="updateform{{identify}}">
	<input type="hidden" name="subscribe.id" value="{{subscribe.id}}"/>
	<div class="form-group first">
		<label class="col-sm-4 control-label">市场区域:</label>
		<div class="col-sm-8">
			<input type="text" name="subscribe.marketarea" value="{{subscribe.marketarea}}" class="form-control" placeholder="市场区域" maxlength="20">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-4 control-label"><span class="required">#</span>产品名称:</label>
		<div class="col-sm-8">
			<input type="text" id="subscribeproductNameKey{{identify}}" name="subscribe.productNameKey" value="{{subscribe.productNameKey}}" class="form-control" placeholder="产品名称" maxlength="20">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-4 control-label">销售方式:</label>
		<div class="col-sm-8">
			<select name="subscribe.saleType" class="form-control">
				<option value="">全部</option>
				<option value="0">普通</option>
				<option value="1">促销</option>
				<option value="2">组团</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-4 control-label">公司信誉:</label>
		<div class="col-sm-8">
			<select name="subscribe.credit" class="form-control">
 				<option value="">全部</option>
 				<option value="1">信誉好</option>
 				<option value="0">信誉一般</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-12">
			<button type="submit" name="update" id="submitupdate{{identify}}" class="btn btn-default btn-lg btn-block">更新订阅</button>
		</div>
	</div>
	<div class="form-group last">
		<div class="col-sm-12">
			<button type="submit" name="delete" id="submitdelete{{identify}}" class="btn btn-default btn-lg btn-block">删除订阅</button>
		</div>
	</div>
</form>
<script type="text/javascript">
$(document).ready(function() {
	$('#updateform{{identify}} select[name="subscribe.saleType"] > option[value="{{subscribe.saleType}}"]').attr('selected', true);
	$('#updateform{{identify}} select[name="subscribe.credit"] > option[value="{{subscribe.credit}}"]').attr('selected', true);
	$('#submitupdate{{identify}}, #submitdelete{{identify}}').on('click', function(e) {
		var $this = $(this);
		$this.attr('disabled', 'disabled');
		if ($this.attr('name') == 'update') {
			var v = [{
				id: 'subscribeproductNameKey{{identify}}',
				msg: '请输入产品名称'
			}];
			var vmsg = [];
			for (var i = 0; i < v.length; i++) {
				var vi = v[i];
				if ('' == $.trim($('#' + vi.id).val())) {
					vmsg[i] = vi.msg;
				}
			}
			if (vmsg.length > 0) {
				Global.longToast(vmsg.join(','));
				$this.removeAttr('disabled');
				return;
			}
		}
		Global.loading();
		$.ajax({
			type: 'GET',
	    	url: GLOBAL_CONTEXT_PATH + '/subscribe/updateJson.html?subscribe.id={{this.id}}',
	    	dataType: 'json',
	    	crossDomain: true,
	    	data: $('#updateform{{identify}}').serialize(),
	    	success: function (data) {
	    		data.identify = new Date().getTime();
				Global.longToast('操作成功');
	    		$this.removeAttr('disabled');
	    		Global.loaded();
	    	},
	    	error: function() {
	    		$this.removeAttr('disabled');
	    		Global.loaded();
	    	}
		});
	});
});
<{{!}}/script>